#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

int strcmp1(char* p1, char* p2)
{
	int js1 = 0;
	int js2 = 0;
	int i = strlen(p1);
	int j = strlen(p2);
	int sum1 = 0;
	int sum2 = 0;;
	while (*p1 != '\0')  
	{
		sum1 = sum1 + *p1;
		p1++;
		js1++;
	}
	while (*p2 != '\0')
	{
		sum2 = sum2 + *p2;
		p2++;
		js2++;
	}
	p1 = p1 - js1;
	p2 = p2 - js2;
	if(sum1==sum2)
	  return 0;
	else 
		while (*p1 != '\0')
		{
			if (*p1 > *p2)
				return *p1 - *p2;
			if(*p1<*p2) return *p1-*p2;
			p1++;
			p2++;
		}
}
int main()
{
	char s1[] = { 0 };
	char s2[] = { 0 };
	gets(s1);
	gets(s2);
	printf("%d", strcmp1(s1, s2));
	return 0;
}